package dao.connectortodb;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;

public class DistributerProperties {

	private Properties property = new Properties();
	private static final String SORRY = "Sorry properties file not found";
	private static final String URL_DRIVER = "url_driver";
	private static final String USER = "user";
	private static final String PASSWORD = "password";
	private static final String DRIVER_NAME = "driverName";
	private static final String PROPERTIES_URL="jdbc.properties";
	private Logger log = Logger.getLogger(DistributerProperties.class);

	public DistributerProperties() {
		try {
			property.load(new FileReader(PROPERTIES_URL));
		} catch (IOException e) {
			log.error(SORRY);
			System.out.println(SORRY);
		}
	}

	public String getUrlDriver() {
		return property.getProperty(URL_DRIVER);
	}

	public String getUser() {
		return property.getProperty(USER);
	}

	public String getPassword() {
		return property.getProperty(PASSWORD);
	}

	public String getDriverName() {
		return property.getProperty(DRIVER_NAME);
	}

}
